package com.itlong.cloud.app.service;

import com.alibaba.fastjson.JSONObject;
import com.itlong.cloud.POJO.DTO.app.old.AppOldUserInfoDto;
import com.itlong.cloud.POJO.VO.app.old.AppOldUserInfoVO;
import com.itlong.cloud.enumerate.oldapp.Code;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * <desc>
 *     旧版APP_登录注册版块服务层接口
 * </desc>
 *
 * @createDate 2017/10/17
 */
public interface IAppOldRegisterService {


    /**
     * <desc>
     *     旧版APP_获取用户项目附加信息
     * </desc>
     * @param userId
     * @param projectId
     * @return
     */
    JSONObject getUserProjectInfo(String userId,String projectId);

    /**
     * <desc>
     *     根据用户输入对象查询用户响应对象集合
     * </desc>
     * @param appOldUserInfoDto
     * @return
     * @author cuiduanwu
     * @createDate 2017/10/17
     */
    List selectVOByDTO(@RequestBody AppOldUserInfoDto appOldUserInfoDto);




    /**
     * <desc>
     *     根据手机号查询用户VO
     * </desc>
     * @param phoneNo
     * @return
     * @author cuiduanwu
     * @createDate 2017/10/17
     */
    AppOldUserInfoVO selectVOByPhone(String phoneNo);


    /**
     * <desc>
     *     根据手机号查询用户DTO
     * </desc>
     * @param phoneNo
     * @return
     * @author cuiduanwu
     * @createDate 2017/10/17
     */
    AppOldUserInfoDto selectDtoByPhone(String phoneNo);

    /**
     * <desc>
     *     根据用户DTO更新用户信息
     * </desc>
     * @param appOldUserInfoDto
     * @return
     * @author cuiduanwu
     * @createDate 2017/10/18
     */
    boolean updateNotNullByAppOldUserInfoDto(AppOldUserInfoDto appOldUserInfoDto);


    /**
     * <desc>
     *     保存旧版App用户对象至缓存
     * </desc>
     * @param appOldUserInfoDto
     * @return
     * @author cuiduanwu
     * @createDate 2017/10/18
     */
    AppOldUserInfoDto saveCacheUser(AppOldUserInfoDto appOldUserInfoDto);

    /**
     * <desc>
     *     保存旧版APP用户的响应对象至缓存
     * </desc>
     * @param appOldUserInfoVO
     * @return
     */
    AppOldUserInfoVO saveCacheUserVO(AppOldUserInfoVO appOldUserInfoVO);

    /**
     * <desc>
     *     旧版APP_注册提交
     * </desc>
     * @param appOldUserInfoVO
     * @param pswd   已加密密码
     * @return
     * @author cuiduanwu
     * @createDate 2017/10/18
     */
    Code registerProjectInfo(AppOldUserInfoVO appOldUserInfoVO,String pswd) throws  Exception;


    /**
     * <desc>
     *     旧版APP_登录
     * </desc>
     * @param phoneNo
     * @param pswd 已加密的密码
     * @param loginDevice
     * @return
     * @throws Exception
     * @author cuiduanwu
     * @createDate 2017/10/23
     */
    AppOldUserInfoVO appLogin(String phoneNo,String pswd,String loginDevice) throws  Exception;



    /**
     *<desc>
     *     旧版APP_忘记密码提交
     *</desc>
     * @param phoneNo
     * @param pswd 已加密的密码
     * @return
     * @throws Exception
     * @author cuiduanwu
     * @createDate 2017/10/30
     */
    Code appRetrievePswd(String phoneNo,String pswd) throws  Exception;



    /**
     * <desc>
     *     旧版APP_更新头像
     * </desc>
     * @param userId
     * @param imageStr
     * @param imageType
     * @return
     * @createDate 2017/10/30
     * @author cuiduanwu
     */
    String updatePhoto(String userId,String imageStr,String imageType) throws Exception;

    /**
     * <desc>
     *     旧版APP_修改密码
     * </desc>
     * @param phoneNo
     * @param oldPswd  已加密的旧密码
     * @param newPswd  已加密的新密码
     * @return
     * @throws Exception
     * @createDate 2017/10/30
     * @author cuiduanwu
     */
    Code appUpdatePswd(String phoneNo,String oldPswd,String newPswd) throws  Exception;

    /**
     * <desc>
     *     旧版APP_修改手机号
     * </desc>
     * @param phoneNo 旧手机号
     * @param loginPswd  已加密的密码
     * @param replacePhoneNo  新手机号
     * @return
     * @throws Exception
     * @createDate 2017/10/30
     * @author cuiduanwu
     */
    Code appUpdatePhone(String phoneNo,String loginPswd,String replacePhoneNo) throws  Exception;

    /**
     * <desc>
     *     旧版APP_修改昵称
     * </desc>
     * @param phoneNo
     * @param nickName
     * @return
     * @throws Exception
     * @createDate 2017/10/30
     * @author cuiduanwu
     */
    Code updateNickName(String phoneNo,String nickName) throws  Exception;


    /**
     * <desc>
     *     旧版APP_修改姓名
     * </desc>
     * @param phoneNo
     * @param userName
     * @return
     * @throws Exception
     * @createDate 2017/10/30
     * @author cuiduanwu
     */
    Code appUpdateUserName(String phoneNo,String userName) throws  Exception;


    /**
     * <desc>
     *     旧版APP_修改性别
     * </desc>
     * @param phoneNo
     * @param sex 性别：0男 1女
     * @return
     * @throws Exception
     * @createDate 2017/10/30
     * @author cuiduanwu
     */
    Code updateUserSex(String phoneNo,String sex) throws  Exception;

    /**
     *  <desc>
     *      旧版APP_检查核验用户的token正确性
     *  </desc>
     * @param phoneNo
     * @param token
     * @return
     * @createDate 2017/10/30
     * @author cuiduanwu
     */
    Code checkUserStatus(String phoneNo,String token);


}
